<!DOCTYPE HTML>
<html>
<HEAD>
<meta charset="utf-8">
<TITLE>员工积分明细</TITLE>
</HEAD>
<body>
    
<?php
include_once("base-class.php");

//新建sae数据库类
$mysql = new SaeMysql();

//获取当前页码
$page=intval($_GET["page"]);

//获取操作标识传入
//$action=$_GET["action"];
//$action= string::un_script_code($action);
//$action= string::un_html($action);


//获取员工ID号传入

//列表数据获取、分页

//计算总数
$count=$mysql->getVar("select COUNT(*) from roster,list where roster_name = list_name ");
//如果数据表里有数据
if($count)
{
    //每页显示记录数
    $page_num = 5000;
    //如果无页码参数则为第一页
    if ($page == 0) $page = 1;
    //计算开始的记录序号
    $from_record = ($page - 1) * $page_num;
    //获取符合条件的数据
    // $list_list=$mysql->getData("select *
    //          from list where $list_name =  $rostar_name
    //          limit $from_record,$page_num");
    
    

        $list_list=$mysql->getData("select list_id,list_name,list_code,gift_item,list_money,list_addtime,list_status,list_checkname,list_checktime
                from roster,list,gift where roster_name = list_name and list_code = gift_code and list_status<2 ORDER BY list_addtime DESC limit $from_record,$page_num ");
    //分页函数
    $multi = multi($count,$page_num, $page, "list_all.php");
}
?>
    <!--页面名称-->
	<h3>员工积分明细</h3>
    <!--列表开始-->

    <table border=1>
   <!--table width="100%" border=1-->
         <tr bgcolor="#cccccc">
            <td>序号</td><td>姓名</td><td>积分代码</td><td>积分项目</td><td>积分分值</td><td>添加时间</td><td>状态</td><td>审核人</td><td>审核时间</td>
        </tr>
        <!--tr>
            <td width= "30">序号</td><td width= "55">姓名</td><td width= "30">积分代码</td><td>积分项目</td><td width= "36">积分分值</td><td width= "80">添加时间</td><td width= "36">状态</td><td width= "36">审核人</td><td width= "80">审核时间</td>
        </tr-->
        <?php
			if($list_list)
            {
                
                foreach($list_list as $value)
                {
                    
                    $value["list_status"]=($value["list_status"]=="0")?"待审核":"审核通过";
                    echo "<tr bgcolor=\"#cccccc\">
                          <td>$value[list_id]</td>
                          <td>$value[list_name]</td>
                          <td>$value[list_code]</td>
                          <td>$value[gift_item]</td>
                          <td>$value[list_money]</td>
                          <td>$value[list_addtime]</td>
                          <td>$value[list_status]</td>
                          <td>$value[list_checkname]</td>
                          <td>$value[list_checktime]</td>                          
                          <tr>";
                }
            }
			else
            {
                echo "<tr><td colspan=7>无记录</td></tr>";
            }
        ?> 
    </table>
<!--   <font size=10>-->
    <div style="font-size:40px">
    <?php

	echo $multi;

    ?>
    </div>
<!--    </font>-->
</body>
</html>
